home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Trusted Irix /B 4.0.4
/
Trusted-Irix B-4.0.1.iso
/
dist
/
eoe1.idb
/
usr
/
include
/
sys
/
ms.h.z
/
ms.h
Wrap
C/C++ Source or Header
|
1992-04-03
|
3KB
|
98 lines
/**************************************************************************
* *
* Copyright ( C ) 1984, 1990, Silicon Graphics, Inc. *
* *
* These coded instructions, statements, and computer programs contain *
* unpublished proprietary information of Silicon Graphics, Inc., and *
* are protected by Federal copyright law. They may not be disclosed *
* to third parties or copied or duplicated in any form, in whole or *
* in part, without the prior written consent of Silicon Graphics, Inc. *
* *
**************************************************************************/
/*
* Internals for the mouse driver
*
* Most of the #define's are "mouse" dependant,
* most of the "warp" factors are not.
*/
#ident "$Revision: 1.5 $"
#ifdef _KERNEL
/* bits from mouse indicating button pressed */
#define RGTBUTTON 0x1
#define MIDBUTTON 0x2
#define LFTBUTTON 0x4
#define ALLBUTTONS ( LFTBUTTON | MIDBUTTON | RGTBUTTON )
/* Parameters for "Warp" */
#define MOUSEMAXRAWDELTA 254 /* abs. value of the sum of two signed char's */
/* defaults -- totally arbitrary, my choice */
#define DEFAULTMS_MULPIPLIER 16
#define DEFAULTCRVFACT 16
#define DEFAULTMS_INFLECTION ( MOUSEMAXRAWDELTA / 3 )
/* default acceleration == ~2.7 above 8 */
#define DEFAULTMS_THRESHOLD 8
#define DEFAULTMS_ACCELERATORN 8
#define DEFAULTMS_ACCELERATORD 3
/* State machine states */
#define MOUS_BUT_STATE 0
#define MOUS_DX1_STATE 1
#define MOUS_DY1_STATE 2
#define MOUS_DX2_STATE 3
#define MOUS_DY2_STATE 4
#define MOUS_LAST_STATE 5
struct _mouse_state {
/* Actual state */
int currentX ; /* as fixed-point n.8 */
int currentY ; /* as fixed-point n.8 */
int currentButtons ;
/* Bounds - 32K to 32K - 1 */
short int minX ;
short int maxX ;
short int minY ;
short int maxY ;
/* "Warp" Variable Accelerators */
unsigned char m1 ;
unsigned char cM ;
unsigned char inflection ;
unsigned char threshold ;
unsigned short int acceleratorN ;
unsigned short int acceleratorD ;
/* Scratch Intra-report Data */
int state ;
signed char report[MOUS_LAST_STATE] ;
/* Stuff to play by the shmiq rules */
struct shmiqlinkid shmiqid ;
/* Misc. Std. Driver stuff */
unsigned int inited :1 ;
struct queue *rq ;
} ;
/* No good excuse for any of the rest of this */
#define DEFAULT_MS_MINX 0
#define DEFAULT_MS_MINY 0
#define DEFAULT_MS_MAXX 1280
#define DEFAULT_MS_MAXY 1024
#endif /* _KERNEL */
struct mscntl {
unsigned short int numerator ;
unsigned short int denominator ;
unsigned short int threshold ;
#define MS_GETCNTL 1
#define MS_SETCNTL 2
#define MS_DOTHRESHOLD 4
#define MS_DOACCELERATION 8
unsigned short int flags ;
} ;
struct mssetpos {
unsigned short int x ;
unsigned short int y ;
} ;
#define MSIOCNTL _IOWR('M',147,struct mscntl)
#define MSIOSETPOS _IOWR('M',149,struct mssetpos)